﻿using System;
using fastCSharp;

namespace diantou.web.question
{
    /// <summary>
    /// 问题编辑日志
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPool = true, IsReferer = false)]
    partial class log : view<log>
    {
        /// <summary>
        /// 日志类型
        /// </summary>
        private enum type
        {
            /// <summary>
            /// 默认问题
            /// </summary>
            None,
            /// <summary>
            /// 回答日志
            /// </summary>
            Answer
        }
        /// <summary>
        /// 编辑日志集合
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private diantou.dataAccess.log[] logs;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="questionId"></param>
        /// <param name="page"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private bool loadView(int questionId, int page, type type)
        {
            if (load(questionId))
            {
                if (type == log.type.Answer)
                {
                    logs = diantou.dataAccess.tcpCall.log.getAnswer(questionId, pageInfo.Size = fastCSharp.config.pub.Default.PageSize, pageInfo.Page = page, out pageInfo.Count);
                }
                else
                {
                    logs = diantou.dataAccess.tcpCall.log.getQuestion(questionId, pageInfo.Size = fastCSharp.config.pub.Default.PageSize, pageInfo.Page = page, out pageInfo.Count);
                }
                return true;
            }
            return false;
        }
    }
}
